/**
 * 通过传入选择器获取元素. promise返回信息
 * 技巧: 拿值通过promise.
 * @param {String} selector
 */
export default function(selector) {
	return new Promise((resolve, reject) => {
		const query = wx.createSelectorQuery()
		query.select(selector).boundingClientRect() 
		query.exec((res) => {
			resolve(res)
		})
	})
}